home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / GRAPHICS.EXE / SHOWMCGA.BAS < prev    next >
BASIC Source File  |  1991-03-19  |  2KB  |  80 lines

  1. ' SHOWTYME
  2. ' by James Ducasse
  3. ' (modified for speed by Andrew Gariepy)
  4. :
  5. ' This is an excellent example of using the high-speed
  6. ' USR 8 and USR 9 Integer SINE and COSINE functions
  7. ' built into all versions of the ZBasic compiler
  8. :
  9. SELECT CARDTYPE
  10.   CASE 0 ' CGA card
  11.     MODE 5
  12.     Colormax = 4
  13.   CASE 1 ' EGA card
  14.     MODE 17
  15.     Colormax = 16
  16.   CASE 2 ' EGA card w/monochrome monitor
  17.     MODE 18
  18.     Colormax = 1
  19.   CASE 3 ' Hercules card
  20.     MODE 20
  21.     Colormax = 1
  22.   CASE 4 ' VGA card
  23.     MODE 22
  24.     Colormax = 16
  25.   CASE 5 ' VGA card /monochrome monitor
  26.     MODE 21
  27.     Colormax = 1
  28.   CASE 6 ' MCGA card
  29.     MODE 23
  30.     Colormax = 256
  31.   CASE 7 ' MCGA card w/monochrome monitor
  32.     MODE 23
  33.     Colormax = 256
  34.   CASE ELSE ' Either MPDA or not recognized!
  35.     MODE 2
  36.     Colormax = 1
  37. END SELECT
  38. CLS : RANDOMIZE : Colormax = 256 : MODE 23
  39. :
  40. CR% = 7
  41. V1 = 4
  42. :
  43. DO
  44.   C = RND(Colormax-1) : G = RND(Colormax-1) : B = RND(Colormax-1)
  45.   COLOR = C,G,B : PRINT @(0,0) "Color ="; C,G,B
  46.   FOR R = 0 TO 256
  47.     A% = USR 9 (Q * R) / 4
  48.     X1 = (USR 9 (R) * A%) / 50 + 512
  49.     Y1 = (USR 8 (R) * A%) / 50 + 384
  50.     B = R + E
  51.     B2% = USR 9 (V1 * B) / 4
  52.     X2 = (USR 9 (B) * B2%) / 50 + 512
  53.     Y2 = (USR 8 (B) * B2%) / 50 + 384
  54.     PLOT X1, Y1 TO X2, Y2
  55.     I$ = INKEY$
  56.     IF LEN(I$) THEN "END"
  57.   NEXT R
  58.   Q = RND(12)
  59.   IF Q = 7 THEN Q = 0
  60.   IF Q = 1 AND V1 = 0 THEN V1 = RND(12)
  61.   E = RND(200)
  62.   V1 = RND(12)
  63.   IF V1 = 7 THEN V1 = 0
  64.   IF V1 > 6 THEN V1 = V1 - 12
  65.   IF Q < 1 AND V1 = 1 THEN V1 = RND(50)
  66.   IF Q = 1 AND V1 = 1 THEN V1 = RND(100)
  67.   CR% = RND(17)
  68.   IF CR% = 2 THEN CR% = 4
  69.   IF CR% = 3 THEN CR% = 6
  70.   IF CR% > 6 AND C4% < 10 THEN CR% = CR% + 4
  71.   CR1% = CR% + 1
  72.   DELAY 2000
  73.   CLS
  74. UNTIL LOOP ' LOOP = 0 so this is a never-ending loop
  75. :
  76. "END"
  77. MODE 2
  78. CLS
  79. END
  80.